/**
 *
 * @constructor
 */
function SettingTime() {
}

SettingTime.init = function () {
    laydate.render({
        elem: '#text_offtime'
        ,type: 'time'
    });
    WriteData();
}
//操作相关方法****************************
function actionRecord(data,type) {
    var postdata={};
    if(type=="offtime")
    {
        postdata = {
            action: type,
            offTime: $("#text_offtime").val(),
        };
        $.ajax({
            url:"/setting/action",
            type:"post",
            data:JSON.stringify(postdata),
            contentType:"application/json",
            dataType:"json",
            success:function(data){
                if (data.code === "200") {
                    swal("操作成功!", "请继续操作", "success");
                } else {
                    swal("操作失败!", "请重试", "error");
                }
            }
        })
    }

}

//给控件赋值****************************
function WriteData() {
    $.ajax({
        url:"/setting/getById/1",
        type:"get",
        contentType:"application/json",
        dataType:"json",
        success:function(data){
            if (data.code === "200") {
                $("#text_offtime").val(data.data.offTime);
            }
        }
    })

}
//状态变更****************************
//*****************************************************************************************
